package pw.goyd.game.model;

import pw.goyd.game.constant.setting.GameSetting;
import pw.goyd.subscribe.PlayerCustomer;


/**
 * 玩家
 *
 * @author StanWind
 */
public class Player {
    private int diamond; //映射到account_info的gold字段

    /**
     * mybatis映射部分
     */
    private String account_id;          //	UUID
    private String nickname;            // 	昵称
    private int gold;                   //	金币
    private String icon_source;         //	头像字段
    private int win_times;              //	胜利场次
    private int all_times;              //	总场次
    private String last_lucky_time;     //	上次奖励发放日期
    private int lucky_count;            //	剩余抽奖次数
    private String last_ad_time;        //	上次广告激励时间
    private int ad_count;               //	广告激励计次 已看


    /**
     * 新建一个临时的Player账号对象
     *
     * @param account_id
     */
    public Player(String account_id) {
        this.account_id = account_id;
        gold = GameSetting.NEW_MONEY;
        icon_source = "0";
        win_times = 0;
        all_times = 0;
    }


    public Player() {

    }

    public int getDiamond() {
        return diamond;
    }

    public void setDiamond(int diamond) {
        this.diamond = diamond;
    }

    public String getAccount_id() {
        return account_id;
    }

    public void setAccount_id(String account_id) {
        this.account_id = account_id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public int getGold() {
        return gold;
    }

    public void setGold(int gold) {
        this.gold = gold;
    }

    public String getIcon_source() {
        return icon_source;
    }

    public void setIcon_source(String icon_source) {
        this.icon_source = icon_source;
    }

    public int getWin_times() {
        return win_times;
    }

    public void setWin_times(int win_times) {
        this.win_times = win_times;
    }

    public int getAll_times() {
        return all_times;
    }

    public void setAll_times(int all_times) {
        this.all_times = all_times;
    }

    public String getLast_lucky_time() {
        return last_lucky_time;
    }

    public void setLast_lucky_time(String last_lucky_time) {
        this.last_lucky_time = last_lucky_time;
    }

    public int getLucky_count() {
        return lucky_count;
    }

    public void setLucky_count(int lucky_count) {
        this.lucky_count = lucky_count;
    }

    public String getLast_ad_time() {
        return last_ad_time;
    }

    public void setLast_ad_time(String last_ad_time) {
        this.last_ad_time = last_ad_time;
    }

    public int getAd_count() {
        return ad_count;
    }

    public void setAd_count(int ad_count) {
        this.ad_count = ad_count;
    }

    /**
     * 转换成子类
     *
     * @return
     */
    public PlayerCustomer toCustomer() {
        PlayerCustomer pc = new PlayerCustomer();
        pc.setDiamond(diamond);
        pc.setAccount_id(account_id);
        pc.setNickname(nickname);
        pc.setGold(gold);
        pc.setIcon_source(icon_source);
        pc.setWin_times(win_times);
        pc.setAll_times(all_times);
        pc.setLast_lucky_time(last_lucky_time);
        pc.setLucky_count(lucky_count);
        pc.setLast_ad_time(last_ad_time);
        pc.setAd_count(ad_count);
        return pc;
    }
}
